<?php 
/////////////////////////////////////////////////////////////////////////////////////		
include "required_code.php"; 

				session_start();
				$ses_user_id =$_SESSION['ses_user_id'];
				$ses_std_id = $_SESSION['ses_std_id'];
				$path1=$_SESSION['path1'];
				$path2=$_SESSION['path2'];
				$path3=$_SESSION['path3'];

				if($ses_user_id <> session_id() or  $ses_std_id ==''){
					echo "Authentication failed";
					echo "<meta http-equiv='refresh' content='2;URL=index.php' />";
					}    
					
							$query2="SELECT * FROM std_progress WHERE std_id=$ses_std_id";
							$db_result2=db_query($query2);
							$result2=mysql_fetch_array($db_result2);
							//echo $result2['pretest_sts'];
							if($result2['pretest_sts']!=1 || $result2['ls_sts']!=1){
								echo "Redirecting";
								echo "<meta http-equiv='refresh' content='1;URL=progress.php' />";
							}
							else{
								
		/////////////////////////////////////////////////////////////////////////////////////						
						?>
						
						<table width="800" border="1" align="center" cellpadding="0" cellspacing="0">
						  <tr>
							<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
							  <tr>
								<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
								  <tr>
									<td width="23%" bgcolor="#FFFFFF"><?php include "header.html"; ?></td>
									</tr>
								</table></td>
							  </tr>
							  <tr>
								<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
								  <tr>
								   
									<td width="80%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
									  <tr>
										<td bgcolor="#00CCFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
										  <tr>
											<td><div align="left"><tt><a href="progress.php">Home</a> &gt; Learning Paths</tt></div></td>
											<td>&nbsp;</td>
											<td><?php include "right_navi.php"; ?></td>
										  </tr>
										</table></td>
									  </tr>
									  <tr>
										<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
										  <tr>
											<td bgcolor="#FFFFFF"><br />
											  <table width="100%" border="0" cellspacing="0" cellpadding="5">
												<tr>
												  <td><table width="100%" border="2" cellspacing="0" cellpadding="0">
												    <tr>
												      <td><?php 
			
			///////////////////DISPLAY PATHS//////////////////////////////////
			
					function call_concept($c,$ses_std_id){
						$query_select_std_vs_c="SELECT * FROM std_vs_concept WHERE std_id=$ses_std_id AND concept=".$c;
						$db_result_select_std_vs_c=db_query($query_select_std_vs_c);
						$result_select_std_vs_c=mysql_fetch_array($db_result_select_std_vs_c);
						
						
						
							if($result_select_std_vs_c['status']==0){
								echo "<a href='concept_analysis.php?c=".$c."'>";
								call_concept_name($c);
								echo "</a>";
							}
							else{
								echo "<a href='concept_analysis.php?c=".$c."'>";
								call_concept_name($c);
								echo "</a> [Passed]";
							}
					}
					
					function concept_connector(){
						echo " --> ";
					}
					function new_line(){
						echo "<br>";
					}
			
			
			if($path1){
				echo "PATH1: ";
				call_concept(1,$ses_std_id);
				concept_connector();
				call_concept(3,$ses_std_id);
				concept_connector();
				call_concept(4,$ses_std_id);
				new_line();
			}
			
			if($path2){
				echo "PATH2: ";
				call_concept(2,$ses_std_id);
				concept_connector();
				call_concept(4,$ses_std_id);
				new_line();
			}
			
			if($path3){
				echo "PATH3: ";
				call_concept(3,$ses_std_id);
				concept_connector();
				call_concept(4,$ses_std_id);
				new_line();
			}
			///////////////////DISPLAY PATHS//////////////////////////////////
													  ?></td>
											        </tr>
												    </table>
											      <p><a href="progress.php">HOME</a></p></td>
												</tr>
												<tr>
												  <td></td>
												</tr>
												<tr>
												  <td></td>
												</tr>
											  </table></td>
										  </tr>
										</table></td>
									  </tr>
									</table></td>
								  </tr>
								</table></td>
							  </tr>
							  <tr>
								<td bgcolor="#FFFFFF"><?php include "footer.html"; ?></td>
							  </tr>
							</table></td>
						  </tr>
						</table>
						</body>
						</html>
						<?php
						/////////////////////////////////////////////////////////////////////////////////////		
							$db_close=db_disconnect($db_open);
							}
/////////////////////////////////////////////////////////////////////////////////////		
?>
